<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8">
	<title>登录</title>
	<meta name="renderer" content="webkit">
	<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
	<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
	<meta name="apple-mobile-web-app-status-bar-style" content="black">
	<meta name="apple-mobile-web-app-capable" content="yes">
	<meta name="format-detection" content="telephone=no">
	<link rel="stylesheet" href="./layui/css/layui.css" media="all" />
	<link rel="stylesheet" href="./css/login.css" media="all" />
</head>
<body bgcolor="#ccc">
	<div class="login">
	    <h1>管理登录</h1>
	    <form class="layui-form">
	    	<div class="layui-form-item">
				<input class="layui-input" name="username" placeholder="用户名" lay-verify="required" type="text" autocomplete="off">
		    </div>
		    <div class="layui-form-item">
				<input class="layui-input" name="password" placeholder="密码" lay-verify="required" type="password" autocomplete="off">
		    </div>
			<button class="layui-btn login_btn" lay-submit="" lay-filter="login">登录</button>
		</form>
	</div>
	<script type="text/javascript" src="./layui/layui.js"></script>
	<script type="text/javascript">
		layui.config({
			base : "js/"
		}).use(['form','layer'],function(){
			var form = layui.form(),
				layer = parent.layer === undefined ? layui.layer : parent.layer,
				$ = layui.jquery;
			//登录按钮事件
			form.on("submit(login)",function(data){
				$.post(window.location.href+'/user_loginCheck',data.field,function(data){
					if(data=='1'){
						layer.msg("登录成功",{time:1000});	
						setTimeout('window.location.href = "./index.jsp";',1000);
					}else{
						layer.msg("登录失败",{time:2000});	
						setTimeout('window.location.href = "./login.html";',2000);
						
					}
				});
				return false;
			})
		})
	</script>
</body>
</html>